from django.contrib import admin
from django.urls import path, include
from rest_framework.documentation import include_docs_urls
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import AllowAny
from rest_framework_simplejwt.views import (
    TokenObtainPairView,
    TokenRefreshView,
    TokenVerifyView
)
from django.urls import path, re_path
from django.views.static import serve


from utils.ResponseJWTToken import MyTokenObtainPairView
# 创建一个自定义的视图，仅实现get方法做测试
# from rest_framework.views import APIView, Response
# class IndexView(APIView):
#     def get(self, request):
#         return Response('This is Index Page!', status=200)

import labor_price.views
urlpatterns = [
# 获取Token的接口

    path('admin/', admin.site.urls),
    path('docs/', include_docs_urls(title='测试平台接口文档')),
    path('pc/', include('labor_price.urls')),

    path('pc/login', MyTokenObtainPairView.as_view(), name='token_obtain_pair222'),
    # path('api/user/register', labor_price.views),

    # path('api/token', TokenObtainPairView.as_view(), name='token_obtain_pair'),
    # 刷新Token有效期的接口
    # path('api/refresh', TokenRefreshView.as_view(), name='token_refresh'),
    # 验证Token的有效性
    # path('api/token/verify', TokenVerifyView.as_view(), name='token_verify'),

    # # 自定义视图
    # path('index/', IndexView.as_view(), name='index')

]
